1. Field of the Invention
This invention relates to computer systems, and more particularly to concurrent execution of software code.
2. Description of the Related Art
Developers often implement distributed transactional applications as part of commercial and non-commercial business solutions for an enterprise. For example, a company may leverage use of an enterprise application that includes various databases distributed across multiple computers. The time spent to complete operations for the application, such as storing data in databases and manipulating data received from users, may be considerable due to high system loads and network latency (e.g., innumerable, simultaneous user requests and long waits for network communication). One technique to improve the efficiency of such applications may involve running independent operations in parallel. For example, a developer may modify application code to include threads so that some of the code (e.g., code that handles separate, independent operations) may execute concurrently. A thread may be a single sequential flow of control within an application program.
Developers may encounter various obstacles when transforming code that is intended to execute sequentially into code fragments (e.g., method, routine, function, subroutine) that may execute concurrently. For example, a particular platform such as Java™ 2 Platform, Enterprise Edition (J2EE™) may impose constraints on thread usage. J2EE uses a multi-tiered distributed component application model. Application logic may be divided into components (e.g., Java™ Servlets, JavaServer Pages™ and Enterprise JavaBeans™) according to function and the various application components may be installed on different computers depending on factors such as security, performance, etc. Although threads may be used in Java, for example, a component model such as J2EE may prevent threads from being started within the application code of a component. Thus, usage of threads as an optimization technique for an enterprise application may be limited or confined.
The typical manner of re-writing code that is intended to execute sequentially into code fragments that may execute concurrently may be burdensome for developers and counter-intuitive for readers of the code (e.g. someone maintaining the code). For example, sequential code may be split between two concurrent methods which may be contrary to what a reader of the code might expect. The relationship of logic between a caller (e.g., the code that calls a method) and the two concurrent methods may be less obvious or clear to a developer than the relationship of logic between the caller and the sequential code. Also, the methods names to be called may be very different from what would be expected or intuitive. For example, in Java, a method call may be object.start( ).